home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: garyq@hpfcla.fc.hp.com (Gary Quakenbush)
- Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
- Subject: Re: C coding problem
- Followup-To: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
- Date: 23 Mar 1996 00:46:02 -0600
- Organization: Hewlett-Packard Fort Collins Site
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4j06na$808@solutions.solon.com>
- References: <4ianbf$h86@solutions.solon.com> <4iemcl$a05@solutions.solon.com> <4io1io$no4@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
- X-Newsreader: TIN [version 1.2 PL1.4]
-
- Konrad Schwarz (schwarz@mips.complang.tuwien.ac.at) wrote:
- : One of C's most defining attributes is the pointer concept
- : which includes the mapping of arrays to pointer arithmetic. If you're
- : going to fight it, it might be better to switch to some other programming
- : language.
-
- : I recently wrote a loop that went like this:
-
- : while (p < end_p)
- : ++*p++;
-
- : Maybe some will find it a counter-example; I think it's good
- : code that embodies the way C is designed to work. Arrays are
- : second rate objects in C. Use pointers.
-
- Ok, I'll bite.
-
- This could be useful as an interview question.
-
- Interviewee gets points for quickly locating in C reference the info
- needed to understand this.
-
- Interviewee gets extra points for mentioning maintainability tradeoffs.
-
- Interviewee gets hired if she rewrites to be trivial for "contractor of
- the month" to understand and maintain.
-